package com.weilive.core.netty;

import java.util.concurrent.TimeUnit;

public class NettyServerConfig {
	
	public static final int DEFAULT_PORT = 5211;
	public static final int DEFAULT_CORE_POOL_SIZE = 0;
	public static final int DEFAULT_MAX_POOL_SIZE = Integer.MAX_VALUE;
	public static final long DEFAULT_KEEP_ALIVE_TIME = 60L;
	public static final TimeUnit DEFAULT_UNIT = TimeUnit.SECONDS;
	public static final int DEFAULT_WORKER_COUNT = Runtime.getRuntime().availableProcessors() * 2;

	private int port = DEFAULT_PORT;
	private int corePoolSize = DEFAULT_CORE_POOL_SIZE;
	private int maximumPoolSize = DEFAULT_MAX_POOL_SIZE;
	private long keepAliveTime = DEFAULT_KEEP_ALIVE_TIME;
	private TimeUnit unit = DEFAULT_UNIT;
	private int workerCount = DEFAULT_WORKER_COUNT;
	
	public int getPort() {
		return port;
	}
	
	public void setPort(int port) {
		this.port = port;
	}

	public int getCorePoolSize() {
		return corePoolSize;
	}

	public void setCorePoolSize(int corePoolSize) {
		this.corePoolSize = corePoolSize;
	}
	
	public int getMaximumPoolSize() {
		return maximumPoolSize;
	}

	public void setMaximumPoolSize(int maximumPoolSize) {
		this.maximumPoolSize = maximumPoolSize;
	}

	public long getKeepAliveTime() {
		return keepAliveTime;
	}

	public void setKeepAliveTime(long keepAliveTime) {
		this.keepAliveTime = keepAliveTime;
	}

	public TimeUnit getUnit() {
		return unit;
	}

	public void setUnit(TimeUnit unit) {
		this.unit = unit;
	}

	public int getWorkerCount() {
		return workerCount;
	}

	public void setWorkerCount(int workerCount) {
		this.workerCount = workerCount;
	}
	
}
